<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>        
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="./update" method="post">
		<fieldset>
			<p>
				<label >姓名</label>
				<input type="hidden" value="${stu.id}" name="id">
				<input name="name" type="text" value="${stu.name}">
			</p>
			<p>
				<label>爱好</label>
					<c:forEach items="${favs}" var="fav">
						
						<input type="checkbox" name="favIds" <c:forEach items="${stu.favs}" var="stuFav" >
							 ${stuFav.id==fav.id?'checked':''}
						   </c:forEach> 
						value="${fav.id}">${fav.name} &nbsp;&nbsp;&nbsp;&nbsp;  
					</c:forEach>
			</p> 
		</fieldset>
		<fieldset>
			<button type="submit">提交</button>
		</fieldset>
	</form>
</body>
</html>